var e = require('../@babel/runtime/helpers/regeneratorRuntime.js'),
  t = require('../@babel/runtime/helpers/objectSpread2.js'),
  a = require('../@babel/runtime/helpers/asyncToGenerator.js'),
  o = getApp();
module.exports = Behavior({
  properties: {},
  options: {},
  data: { _privateShare: !0, canDraw_pt: !1 },
  pageLifetimes: {},
  created: function () {},
  attached: function () {},
  ready: function () {},
  methods: {
    _hackB: function () {},
    _returnPinData: function (e) {
      var t = this.data.pin__GoodsData,
        a = t.pin_param || '',
        r = t.goods_id || 0,
        n = wx.getStorageSync('user'),
        s = n.member ? n.member.type : 0,
        i = n.memberProfile
          ? '【'.concat(n.memberProfile.nickname, '】邀您拼团：')
          : '【'.concat(o.CONFIG.APP_NAME, '】');
      return {
        title: ''.concat(i).concat(t.share_title || t.title),
        path: '/pages/goodsDetail/goodsDetail?goodsId='
          .concat(r, '&rid=')
          .concat(a, '&rtype=')
          .concat(s),
        imageUrl: t.share_thumb || t.thumb,
      };
    },
    _showShare: function (e) {
      var t = this.selectComponent('#ShareModel_pt');
      t && t._show();
      var a = getCurrentPages();
      'packageOrder/pages/afterPay/afterPay' === a[a.length - 1].route &&
        setTimeout(function () {
          a[a.length - 1].setData({ showPinTuan: !1 });
        }, 1e3),
        console.log(a);
    },
    _pinBtnTap: function (e) {
      var t = e.currentTarget.dataset.item;
      this._setPinGoodsData(t), this._showShare();
    },
    _setPinGoodsData: function (e) {
      var t = e;
      (t.id = e.goods_id), this.setData({ pin__GoodsData: t, canDraw_pt: !0 });
    },
    _ptShare_getGoodsDeta: function (r, n) {
      var s = this;
      return a(
        e().mark(function a() {
          var i, d;
          return e().wrap(function (e) {
            for (;;)
              switch ((e.prev = e.next)) {
                case 0:
                  return (
                    (e.next = 2),
                    o.$api.goods.getGoodsDetail(
                      { id: r, api_version: '3.0' },
                      { loading: !0 },
                    )
                  );
                case 2:
                  (i = e.sent),
                    console.log(i),
                    delete i.data.aftersale_explain,
                    delete i.data.content,
                    delete i.data.buyers,
                    delete i.data.description,
                    delete i.data.goods_question,
                    delete i.data.param,
                    delete i.data.properties,
                    delete i.data.skuData,
                    delete i.data.sku_img,
                    (d = t(t({}, i.data), {}, { skuData: [], properties: [] })),
                    delete i.names,
                    delete i.data,
                    delete i.member_card,
                    delete i.aftersale_explain,
                    delete i.goods_question,
                    delete i.goods_material,
                    s.setData(
                      {
                        goodsId: r,
                        detail_goods: d,
                        goodsData: t({}, i),
                        canDraw_pt: !0,
                      },
                      function () {
                        n && s._showShare();
                      },
                    );
                case 21:
                case 'end':
                  return e.stop();
              }
          }, a);
        }),
      )();
    },
  },
});
